package com.flynn.rock.system.controller;

import com.flynn.rock.model.PageResult;
import com.flynn.rock.model.Response;
import com.flynn.rock.system.model.request.PageOperateLogRequest;
import com.flynn.rock.system.model.vo.OperateLogVo;
import com.flynn.rock.system.service.SysOperateLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sys/operate/log")
@AllArgsConstructor
@Tag(name = "操作日志")
public class SysOperateLogController {

    private SysOperateLogService sysOperateLogService;


    @PostMapping("/page")
    @Operation(summary = "分页查询操作日志")
    public Response<PageResult<OperateLogVo>> pageOperateLog(@RequestBody @Validated PageOperateLogRequest request) {
        return Response.success(sysOperateLogService.pageOperateLog(request));
    }
}
